package hz.mobileproject.pda.toolsmanager.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import org.xutils.view.annotation.ViewInject;

import java.util.List;

import hz.mobileproject.pda.R;
import hz.mobileproject.pda.toolsmanager.bean.response.RP_FreeCountTools;
import hz.mobileproject.pda.ui.base.BaseCustomAdapter;

/**
 * Created by Lc on 2018/5/7.
 */

public class ToolsStockAdapter2 extends BaseCustomAdapter<RP_FreeCountTools,ToolsStockAdapter2.ViewHolder> {


    public ToolsStockAdapter2(Context mContext, List<RP_FreeCountTools> list) {
        super(mContext, list);
    }

    @Override
    protected int bindView() {
        return R.layout.item_tools_stock2;
    }

    @Override
    protected ViewHolder createViewHolder() {
        return new ViewHolder();
    }

    @Override
    protected void bindData(int position, View convertView, ViewHolder viewHolder) {
        viewHolder.tv_tool_name.setText(mList.get(position).getTool_type_name());
        viewHolder.tv_tools_stock_all_count.setText(mList.get(position).getTotal_num()+"");
        viewHolder.tv_tools_stock_grant_count.setText(mList.get(position).getBorrow_out_num()+"");
    }



    class ViewHolder{
        @ViewInject(R.id.tv_tools_tool_name)
        private TextView tv_tool_name;
        @ViewInject(R.id.tv_tools_stock_all_count)
        private TextView tv_tools_stock_all_count;
        @ViewInject(R.id.tv_tools_stock_grant_count)
        private TextView tv_tools_stock_grant_count;
    }
}
